﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL;
using PCCS.Management.AdminManage;

namespace PCCS.Management
{
    public partial class _out : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //日志
                Models.AdminLog log = new Models.AdminLog();
                int logId = Convert.ToInt32(Session["admin"].ToString());
                string logName = AdminManager.GetAdminByAdminID(logId).AdminName;
                log.AdminName = logName;
                log.LogTime = DateTime.Now;
                log.LogDesc = "管理员退出平台";
                AdminLogManager.AddAdminLog(log);

                Session["admin"] = null;
                Session.RemoveAll();
                Session.Clear();
                Response.Redirect("login.aspx");
            }
        }
    }
}
